#include <stdio.h>
int main(int argc, char const *argv[])
{
    int array[] = {9,5,2,7,12,4};
    int size = sizeof(array)/sizeof(array[0]);
    int step = 0;
    int minNum = 0;
    int temp = 0;
    for(step=0;step!=size;step++){
        minNum = step;
        for(int i=step;i<size;i++){
            if(array[i]<array[minNum]){
                minNum = i;
            }
        }
        temp = array[minNum];
        array[minNum] = array[step];
        array[step] = temp;
    }
    for(int j=0;j<size;j++){
        printf("%d ",array[j]);
    }
}
